package com.example.activitidemo.controller.user;

import com.example.activitidemo.dto.User1;
import com.example.activitidemo.service.event.AssigneeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserDataController {
    @Autowired
    private AssigneeService assigneeService;

    @PostMapping("/save-user")
    @ApiOperation(value = "保存人员实体")
    public String save(@RequestBody User1 user1) {
        assigneeService.save(user1);
        return "人员保存成功！";
    }

    @DeleteMapping("/delete-user")
    @ApiOperation(value = "删除人员")
    public String delete(String id) {
        //逻辑删除
        assigneeService.delete(id);
        return "删除成功！";
    }

}
